PRINT 'v_fa_summary_approval' 
IF EXISTS (SELECT * FROM SYSOBJECTS WHERE id = object_id(N'[dbo].[v_fa_summary_approval]') AND sysstat & 0xf = 2)
     DROP VIEW [dbo].[v_fa_summary_approval]
GO

CREATE VIEW v_fa_summary_approval AS
SELECT
	m.code,
	m.app_user_code,
	m.app_user_name,
	m.app_dept_code,
	m.app_dept_name,
	m.total_travel_amt,
	b.leadertitle
	
	FROM ce_cost_expense_m m
	LEFT JOIN [BPMDB].[dbo].[BPMSysOUMembers] b on m.app_user_code=b.useraccount
GO

--drop view v_fa_summary_approval

--select * from  v_fa_summary_approval
